Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 skin-theme-clientpref-day vector-sticky-header-enabled" lang="de" dir="ltr"><head>
<meta charset="UTF-8">
<title>K-Means-Algorithmus</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./_res_/favicon.png">
<link rel="canonical" href="https://de.wikipedia.org/wiki/K-Means-Algorithmus"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link href="./_mw_/ext.gadget.citeRef.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.defaultPlainlinks.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiCommonHide.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiCommonLayout.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiCommonStyle.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiDarkmode.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiResponsive.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.specialSearch.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
<link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
<link rel="stylesheet" type="text/css" href="./_res_/footer.css">
<link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-K-Means-Algorithmus rootpage-K-Means-Algorithmus skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading"><i>k</i>-Means-Algorithmus</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="contentSub">
<div id="mw-content-subtitle"></div>
</div>
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="de" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="de" dir="ltr"><p>Ein <b><i>k</i>-Means-Algorithmus</b> ist ein Verfahren zur <a href="Vektorquantisierung" title="Vektorquantisierung">Vektorquantisierung</a>, das auch zur <a href="Clusteranalyse" title="Clusteranalyse">Clusteranalyse</a> verwendet wird. Dabei wird aus einer Menge von ähnlichen Objekten eine vorher bekannte Anzahl von <i>k</i> Gruppen gebildet. Der Algorithmus ist eine der am häufigsten verwendeten Techniken zur Gruppierung von Objekten, da er schnell die Zentren der Cluster findet. Dabei bevorzugt der Algorithmus Gruppen mit geringer Varianz und ähnlicher Größe.
</p><p>Der <a href="Algorithmus" title="Algorithmus">Algorithmus</a> hat starke Ähnlichkeiten mit dem <a href="EM-Algorithmus" title="EM-Algorithmus">EM-Algorithmus</a> und zeichnet sich durch seine Einfachheit aus.<sup id="cite_ref-OpenCV.479_1-0" class="reference"><a href="#cite_note-OpenCV.479-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
Erweiterungen sind der <b>k-Median-Algorithmus</b> und der <b>k-Means++ Algorithmus</b>.
</p>

<div class="mw-heading mw-heading2"><h2 id="Historische_Entwicklung">Historische Entwicklung</h2></div>
<p>Der Begriff „k-means“ wurde zuerst von MacQueen 1967 verwendet,<sup id="cite_ref-macqueen1967_2-0" class="reference"><a href="#cite_note-macqueen1967-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> die Idee geht jedoch auf <a href="Hugo_Steinhaus" title="Hugo Steinhaus">Hugo Steinhaus</a> 1957 zurück.<sup id="cite_ref-Steinhaus.801-804_3-0" class="reference"><a href="#cite_note-Steinhaus.801-804-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> Der heutzutage meist als „k-means-Algorithmus“ bezeichnete Standard-Algorithmus wurde 1957 von Lloyd zur <a href="Puls-Code-Modulation" title="Puls-Code-Modulation">Puls-Code-Modulation</a> vorgeschlagen, aber erst 1982 in einer Informatik-Zeitschrift publiziert<sup id="cite_ref-lloyd1957_4-0" class="reference"><a href="#cite_note-lloyd1957-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> und deckt sich weitestgehend mit der Methode von Forgy, die 1965 publiziert wurde.<sup id="cite_ref-forgy65_5-0" class="reference"><a href="#cite_note-forgy65-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> Eine weitere Variante ist die von Hartigan und Wong, die unnötige Distanzberechnungen vermeidet, indem sie auch den Abstand zum zweitnächsten Mittelpunkt verwendet.<sup id="cite_ref-hartigan1975_6-0" class="reference"><a href="#cite_note-hartigan1975-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-hartigan1979_7-0" class="reference"><a href="#cite_note-hartigan1979-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> Die Algorithmen werden den genannten Personen oft falsch zugeordnet: Insbesondere wird oft der Algorithmus von Lloyd/Forgy beschrieben, als Quelle jedoch MacQueen genannt.
</p>
<div class="mw-heading mw-heading2"><h2 id="Problemstellung">Problemstellung</h2></div>
<p>Ziel von <i>k</i>-Means ist es, den Datensatz so in <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> Partitionen zu teilen, dass die Summe der quadrierten Abweichungen von den Cluster-Schwerpunkten minimal ist. Mathematisch entspricht dies der Optimierung der Funktion
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle J=\sum _{i=1}^{k}\sum _{\mathbf {x} _{j}\in S_{i}}{\|\mathbf {x} _{j}-{\boldsymbol {\mu }}_{i}\|^{2}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>J</mi>
<mo>=</mo>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</munderover>
<munder>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo>∈<!-- ∈ --></mo>
<msub>
<mi>S</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mrow>
</munder>
<mrow class="MJX-TeXAtom-ORD">
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo>−<!-- − --></mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">μ<!-- μ --></mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
<msup>
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle J=\sum _{i=1}^{k}\sum _{\mathbf {x} _{j}\in S_{i}}{\|\mathbf {x} _{j}-{\boldsymbol {\mu }}_{i}\|^{2}}}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/baecba31ac1960c0de8cea1c2e3ffc815871754f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.671ex; width:24.125ex; height:8.009ex;" alt="{\displaystyle J=\sum _{i=1}^{k}\sum _{\mathbf {x} _{j}\in S_{i}}{\|\mathbf {x} _{j}-{\boldsymbol {\mu }}_{i}\|^{2}}}" loading="lazy"></span></dd></dl>
<p>mit den Datenpunkten <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {x} _{j}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {x} _{j}}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/da7e57d3f8c537992b45488f9586aec0c35a85f0.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:2.321ex; height:2.343ex;" alt="{\displaystyle \mathbf {x} _{j}}" loading="lazy"></span> und den <a href="Mittelwert" title="Mittelwert">Schwerpunkten</a> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\boldsymbol {\mu }}_{i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">μ<!-- μ --></mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\boldsymbol {\mu }}_{i}}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1fb8eff83748a7c926b7fb0774c469d6dd949a5d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:2.445ex; height:2.176ex;" alt="{\displaystyle {\boldsymbol {\mu }}_{i}}" loading="lazy"></span> der Cluster <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle S_{i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>S</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle S_{i}}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/de6e810a93f67802ecb603ee0e3324005c6e583e.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.225ex; height:2.509ex;" alt="{\displaystyle S_{i}}" loading="lazy"></span>.
Diese Zielfunktion basiert auf der <a href="Methode_der_kleinsten_Quadrate" title="Methode der kleinsten Quadrate">Methode der kleinsten Quadrate</a> und man spricht auch von <i>Clustering durch Varianzminimierung</i>,<sup id="cite_ref-Ester,Sander_8-0" class="reference"><a href="#cite_note-Ester,Sander-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> da die Summe der Varianzen der Cluster minimiert wird. Da zudem <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \|\mathbf {x} _{j}-{\boldsymbol {\mu }}_{i}\|^{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo>−<!-- − --></mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold-italic">μ<!-- μ --></mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
<msup>
<mo fence="false" stretchy="false">‖<!-- ‖ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \|\mathbf {x} _{j}-{\boldsymbol {\mu }}_{i}\|^{2}}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/104bd0de5439f0a94e116fa92252b760245f6552.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:10.985ex; height:3.343ex;" alt="{\displaystyle \|\mathbf {x} _{j}-{\boldsymbol {\mu }}_{i}\|^{2}}" loading="lazy"></span> die quadrierte <a href="Euklidische_Distanz" class="mw-redirect" title="Euklidische Distanz">Euklidische Distanz</a> ist, ordnet <i>k</i>-Means effektiv jedes Objekt dem nächstgelegenen (nach Euklidischer Distanz) Clusterschwerpunkt zu. Umgekehrt ist das arithmetische Mittel ein <a href="Methode_der_kleinsten_Quadrate" title="Methode der kleinsten Quadrate">Kleinste-Quadrate-Schätzer</a>, optimiert also ebenfalls dieses Kriterium.
</p>
<div class="mw-heading mw-heading2"><h2 id="Algorithmen">Algorithmen</h2></div>
<p>Da die Suche nach der optimalen Lösung schwer ist (<a href="NP-Schwere" title="NP-Schwere">NP-schwer</a>), wird im Normalfall ein approximativer Algorithmus verwendet wie die Heuristiken von Lloyd oder MacQueen. Da die Problemstellung von <i>k</i> abhängig ist, muss dieser Parameter vom Benutzer festgelegt werden. Es existieren jedoch auch Ansätze, durch Verwendung eines zweiten Objektes diesen Parameter zu wählen (vgl. X-Means, <a href="Akaike-Informationskriterium" class="mw-redirect" title="Akaike-Informationskriterium">Akaike-Informationskriterium</a>, <a href="Bayessches_Informationskriterium" class="mw-redirect" title="Bayessches Informationskriterium">bayessches Informationskriterium</a> und <a href="Silhouettenkoeffizient" title="Silhouettenkoeffizient">Silhouettenkoeffizient</a>).
</p>
<div class="mw-heading mw-heading3"><h3 id="Lloyd-Algorithmus">Lloyd-Algorithmus</h3></div>

<p>Der am häufigsten verwendete <i>k</i>-Means-Algorithmus ist der Lloyd-Algorithmus, der oft als „der <i>k</i>-means-Algorithmus“ bezeichnet wird, obwohl Lloyd diesen Namen nicht verwendet hat. Lloyds Algorithmus besteht aus drei Schritten:
</p>
<ol><li><b>Initialisierung:</b> Wähle <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> zufällige Mittelwerte (<i>Means</i>): <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {m} _{1}^{(1)},\ldots ,\mathbf {m} _{k}^{(1)}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">m</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mrow>
</msubsup>
<mo>,</mo>
<mo>…<!-- … --></mo>
<mo>,</mo>
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">m</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mrow>
</msubsup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {m} _{1}^{(1)},\ldots ,\mathbf {m} _{k}^{(1)}}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1faa5665db2fecc3d01cf2840f687b387c0ba420.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:14.298ex; height:3.676ex;" alt="{\displaystyle \mathbf {m} _{1}^{(1)},\ldots ,\mathbf {m} _{k}^{(1)}}" loading="lazy"></span> aus dem Datensatz.</li>
<li><b>Zuordnung:</b> Jedes Datenobjekt wird demjenigen Cluster zugeordnet, bei dem die Cluster-Varianz am wenigsten erhöht wird.<br><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle S_{i}^{(t)}=\left\{\mathbf {x} _{j}:{\big \|}\mathbf {x} _{j}-\mathbf {m} _{i}^{(t)}{\big \|}^{2}\leq {\big \|}\mathbf {x} _{j}-\mathbf {m} _{i^{*}}^{(t)}{\big \|}^{2}{\text{ für alle }}i^{*}=1,\ldots ,k\right\}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msubsup>
<mi>S</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">(</mo>
<mi>t</mi>
<mo stretchy="false">)</mo>
</mrow>
</msubsup>
<mo>=</mo>
<mrow>
<mo>{</mo>
<mrow>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo>:</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mo symmetric="true" maxsize="1.2em" minsize="1.2em">‖</mo>
</mrow>
</mrow>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo>−<!-- − --></mo>
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">m</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">(</mo>
<mi>t</mi>
<mo stretchy="false">)</mo>
</mrow>
</msubsup>
<msup>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mo symmetric="true" maxsize="1.2em" minsize="1.2em">‖</mo>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>≤<!-- ≤ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mo symmetric="true" maxsize="1.2em" minsize="1.2em">‖</mo>
</mrow>
</mrow>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo>−<!-- − --></mo>
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">m</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<msup>
<mi>i</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo>∗<!-- ∗ --></mo>
</mrow>
</msup>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">(</mo>
<mi>t</mi>
<mo stretchy="false">)</mo>
</mrow>
</msubsup>
<msup>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mo symmetric="true" maxsize="1.2em" minsize="1.2em">‖</mo>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mrow class="MJX-TeXAtom-ORD">
<mtext>&nbsp;für alle&nbsp;</mtext>
</mrow>
<msup>
<mi>i</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo>∗<!-- ∗ --></mo>
</mrow>
</msup>
<mo>=</mo>
<mn>1</mn>
<mo>,</mo>
<mo>…<!-- … --></mo>
<mo>,</mo>
<mi>k</mi>
</mrow>
<mo>}</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle S_{i}^{(t)}=\left\{\mathbf {x} _{j}:{\big \|}\mathbf {x} _{j}-\mathbf {m} _{i}^{(t)}{\big \|}^{2}\leq {\big \|}\mathbf {x} _{j}-\mathbf {m} _{i^{*}}^{(t)}{\big \|}^{2}{\text{ für alle }}i^{*}=1,\ldots ,k\right\}}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/2886e84dcfff67ee62a2b356ca8819b8a73f6505.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.838ex; width:63.704ex; height:4.843ex;" alt="{\displaystyle S_{i}^{(t)}=\left\{\mathbf {x} _{j}:{\big \|}\mathbf {x} _{j}-\mathbf {m} _{i}^{(t)}{\big \|}^{2}\leq {\big \|}\mathbf {x} _{j}-\mathbf {m} _{i^{*}}^{(t)}{\big \|}^{2}{\text{ für alle }}i^{*}=1,\ldots ,k\right\}}" loading="lazy"></span></li>
<li><b>Aktualisieren:</b> Berechne die Mittelpunkte der Cluster neu:<br><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {m} _{i}^{(t+1)}={\frac {1}{|S_{i}^{(t)}|}}\sum _{\mathbf {x} _{j}\in S_{i}^{(t)}}\mathbf {x} _{j}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">m</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">(</mo>
<mi>t</mi>
<mo>+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mrow>
</msubsup>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mn>1</mn>
<mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<msubsup>
<mi>S</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">(</mo>
<mi>t</mi>
<mo stretchy="false">)</mo>
</mrow>
</msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
</mrow>
</mfrac>
</mrow>
<munder>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo>∈<!-- ∈ --></mo>
<msubsup>
<mi>S</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">(</mo>
<mi>t</mi>
<mo stretchy="false">)</mo>
</mrow>
</msubsup>
</mrow>
</munder>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {m} _{i}^{(t+1)}={\frac {1}{|S_{i}^{(t)}|}}\sum _{\mathbf {x} _{j}\in S_{i}^{(t)}}\mathbf {x} _{j}}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/cdd16cba1836f523f4f11d149ac3826598506c5e.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -4.505ex; width:23.951ex; height:7.843ex;" alt="{\displaystyle \mathbf {m} _{i}^{(t+1)}={\frac {1}{|S_{i}^{(t)}|}}\sum _{\mathbf {x} _{j}\in S_{i}^{(t)}}\mathbf {x} _{j}}" loading="lazy"></span></li></ol>
<p>Die Schritte 2–3 werden dabei so lange wiederholt, bis sich die Zuordnungen nicht mehr ändern.
</p>
<div class="mw-heading mw-heading3"><h3 id="MacQueen’s_Algorithmus"><span id="MacQueen.E2.80.99s_Algorithmus"></span>MacQueen’s Algorithmus</h3></div>
<p>MacQueen führte mit dem Begriff „<i>k</i>-Means“ einen anderen Algorithmus ein:
</p>
<ol><li>Wähle die ersten <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> Elemente als Clusterzentren</li>
<li>Weise jedes neue Element dem Cluster zu, bei dem sich die Varianz am wenigsten erhöht, und aktualisiere das Clusterzentrum</li></ol>
<p>Während es ursprünglich – vermutlich – nicht vorgesehen war, kann man auch diesen Algorithmus iterieren, um ein besseres Ergebnis zu erhalten.
</p>
<div class="mw-heading mw-heading3"><h3 id="Variationen">Variationen</h3></div>
<ul><li>k-Means ++ versucht, bessere Startpunkte zu finden.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup></li>
<li>Der Filtering-Algorithmus verwendet als <a href="Datenstruktur" title="Datenstruktur">Datenstruktur</a> einen <a href="K-d-Baum" title="K-d-Baum">k-d-Baum</a>.<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup></li>
<li>Der k-Means-Algorithmus kann beschleunigt werden unter Berücksichtigung der <a href="Dreiecksungleichung" title="Dreiecksungleichung">Dreiecksungleichung</a>.<sup id="cite_ref-Elkan_11-0" class="reference"><a href="#cite_note-Elkan-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup></li>
<li>Bisecting k-means beginnt mit <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k=2}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
<mo>=</mo>
<mn>2</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k=2}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/0bd301789e1f25a3da4be297ff637754ebee5f5d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:5.472ex; height:2.176ex;" alt="{\displaystyle k=2}" loading="lazy"></span>, und teilt dann immer den größten Cluster, bis das gewünschte <i>k</i> erreicht ist.</li>
<li>X-means beginnt mit <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k=2}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
<mo>=</mo>
<mn>2</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k=2}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/0bd301789e1f25a3da4be297ff637754ebee5f5d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:5.472ex; height:2.176ex;" alt="{\displaystyle k=2}" loading="lazy"></span> und erhöht <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> so lange, bis sich ein sekundäres Kriterium (Akaike-Informationskriterium, oder bayessches Informationskriterium) nicht weiter verbessert.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Voraussetzungen">Voraussetzungen</h2></div>
<p><i>k</i>-Means optimiert die quadratischen Abweichungen von einem Mittelwert. Es kann daher nur mit numerischen Attributen verwendet werden, bei denen ein sinnvoller Mittelwert berechnet werden kann. Kategorielle Attribute (bspw. „Auto“, „LKW“, „Fahrrad“) können nicht verwendet werden, da hier kein Mittelwert berechnet werden kann.
</p><p>Der Parameter <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span>, die Anzahl der Cluster, muss im Voraus bekannt sein. Er kann jedoch auch experimentell bestimmt werden. Das Problem ist, dass die verschiedenen Cluster miteinander verglichen werden müssen und die Kostenfunktion mit steigendem <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> monoton sinkt. Eine Lösung ist der <a href="Silhouettenkoeffizient" title="Silhouettenkoeffizient">Silhouettenkoeffizient</a>, der eine von <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> unabhängige Bewertung von Clusterungen liefert. Hierbei wird nicht nur geprüft, wie weit ein Punkt vom eigenen Clusterschwerpunkt entfernt ist, sondern es gehen auch die Entfernungen von anderen Clusterschwerpunkten in die Bewertung des Clustering mit ein.
</p><p>Die Cluster im Datensatz müssen etwa gleich groß sein, da der Algorithmus den Datensatz stets an der Mitte zwischen zwei Clusterzentren partitioniert.
</p><p>Der Datensatz darf nicht viel Rauschen bzw. nicht viele <a href="Ausrei%C3%9Fer" title="Ausreißer">Ausreißer</a> enthalten. Fehlerhafte Datenobjekte verschieben die berechneten Clusterzentren oft erheblich, und der Algorithmus hat keine Vorkehrungen gegen derartige Effekte (vgl. <a href="DBSCAN" title="DBSCAN">DBSCAN</a>, das „Noise“-Objekte explizit vorsieht).
</p>
<div class="mw-heading mw-heading2"><h2 id="Probleme">Probleme</h2></div>

<p><i>k</i>-Means ist ein leistungsfähiger Algorithmus, jedoch nicht ohne Schwachstellen. Ein <i>k</i>-Means-Algorithmus muss nicht die beste mögliche Lösung finden. Die gefundene Lösung hängt stark von den gewählten Startpunkten ab. Der einfachste Ansatz ist, den Algorithmus mehrmals hintereinander mit verschiedenen Startwerten zu starten und die beste Lösung zu nehmen. Es gibt aber auch viele Überlegungen, wie eine geeignete Verteilung der Startwerte erreicht werden kann. Zu nennen sind unter anderem k-means++, aber auch mit dem Ziehen kleiner Stichproben können die Clusterzentren vor dem Start von k-means angenähert werden. Außerdem macht es einen Unterschied, ob man beliebige Clusterzentren wählt, oder jeden Punkt einem beliebigen Cluster zuordnet und dann die Clusterzentren ermittelt.
</p><p>Ein weiterer Nachteil ist, dass die Anzahl der Clusterzentren <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> im Voraus gewählt wird. Bei Verwendung eines ungeeigneten <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> können sich komplett andere, unter Umständen unintuitive Lösungen ergeben. Bei einem „falschen“ <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> kann kein gutes Clustering erfolgen. Die Lösung ist, verschiedene Werte für <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> zu probieren und dann ein geeignetes zu wählen, zum Beispiel mit Hilfe des <a href="Silhouettenkoeffizient" title="Silhouettenkoeffizient">Silhouettenkoeffizienten</a>, oder durch Vergleich der verschiedenen Clusteringkosten.
</p><p>Gruppen in den Daten können sich, wie in dem gezeigten Schwertlilien-Beispiel, überlappen und nahtlos ineinander übergehen. In einem solchen Fall kann <i>k</i>-Means diese Gruppen nicht zuverlässig trennen, da die Daten nicht dem verwendeten Cluster-Modell folgen.
</p><p>Des Weiteren sucht <i>k</i>-Means stets konvexe Cluster (bedingt durch die Minimierung des Abstandes zum Clusterschwerpunkt). Andere Algorithmen wie <a href="DBSCAN" title="DBSCAN">DBSCAN</a> können auch beliebig geformte „dichtebasierte“ Cluster finden. Was ebenfalls von <i>k</i>-Means nicht unterstützt wird, sind hierarchische Cluster (also Cluster, die wiederum eine Clusterstruktur aufweisen), wie sie beispielsweise mit <a href="OPTICS" title="OPTICS">OPTICS</a> gefunden werden können.
</p><p>Als letztes wird in k-means jeder Punkt einem Cluster zugewiesen, es gibt keine Möglichkeit Ausreißer zu erkennen. Diese können das Ergebnis stark verfälschen. Abhilfe kann hier eine vorherige Noisereduktion schaffen, oder andere Algorithmen, wie <a href="DBSCAN" title="DBSCAN">DBSCAN</a>, die automatisch Noise erkennen.
</p>
<div class="mw-heading mw-heading2"><h2 id="Erweiterungen">Erweiterungen</h2></div>
<div class="mw-heading mw-heading3"><h3 id="K-Median">K-Median</h3></div>
<p>Im k-Median-Algorithmus wird im Zuweisungschritt statt der euklidischen Distanz die <a href="Manhattan-Distanz" class="mw-redirect" title="Manhattan-Distanz">Manhattan-Distanz</a> verwendet. Im Updateschritt wird der <a href="Median" title="Median">Median</a> statt des <a href="Mittelwert" title="Mittelwert">Mittelwerts</a> verwendet.<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="K-Means++"><span id="K-Means.2B.2B"></span>K-Means++</h3></div>
<p>Der k-Means++-Algorithmus wählt die Cluster-Schwerpunkte nicht zufällig, sondern nach folgender Vorschrift:
</p>
<ol><li>Wähle als ersten Cluster-Schwerpunkt zufällig ein Objekt aus</li>
<li>Für jedes Objekt berechne den Abstand <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle D(x)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>D</mi>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle D(x)}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/be208da111170920787fb435ff586d2377b43cc5.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:5.063ex; height:2.843ex;" alt="{\displaystyle D(x)}" loading="lazy"></span> zum nächstgelegenen Cluster-Schwerpunkt</li>
<li>Wähle zufällig als nächsten Cluster-Schwerpunkt ein Objekt aus. Die Wahrscheinlichkeit, mit der ein Objekt ausgewählt wird, ist proportional zu <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle D^{2}(x)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle D^{2}(x)}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/a38f5b460a11e10caec89ade857e12ae00f8adde.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.117ex; height:3.176ex;" alt="{\displaystyle D^{2}(x)}" loading="lazy"></span>, d.&nbsp;h. je weiter das Objekt von den bereits gewählten Cluster-Schwerpunkten entfernt ist, desto wahrscheinlicher ist es, dass es ausgewählt wird.</li>
<li>Wiederhole Schritt 2 und 3 bis <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> Cluster-Schwerpunkte bestimmt sind</li>
<li>Führe nun den üblichen k-Means Algorithmus aus</li></ol>
<p>In der Regel konvergiert der nachfolgende k-Means Algorithmus in wenigen Schritten. Die Ergebnisse sind so gut wie bei einem üblichen k-Means-Algorithmus, jedoch ist der Algorithmus typischerweise fast doppelt so schnell wie der k-Means-Algorithmus.<sup id="cite_ref-kanungo_14-0" class="reference"><a href="#cite_note-kanungo-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="K-Medoids_(PAM)"><span id="K-Medoids_.28PAM.29"></span>K-Medoids (PAM)</h3></div>
<p>Der Algorithmus PAM (Partitioning Around Medoids, Kaufman und Rousseeuw, 1990) – auch bekannt als k-Medoids<sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup> – kann als Variante des k-Means Algorithmus interpretiert werden, die mit <i>beliebigen</i> Distanzen konvergiert.
</p>
<ol><li>Wähle <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k}</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/c3c9a2c7b599b37105512c5d570edc034056dd40.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.211ex; height:2.176ex;" alt="{\displaystyle k}" loading="lazy"></span> Objekte als Cluster-Schwerpunkte (Medoid) aus</li>
<li>Ordne jedes Objekt dem nächsten Cluster-Schwerpunkt zu</li>
<li>Für jeden Cluster-Schwerpunkt und jeden Nicht-Cluster-Schwerpunkt vertausche die Rollen</li>
<li>Berechne für jede Vertauschung die Summe der Distanzen oder Unähnlichkeiten</li>
<li>Wähle als neue Cluster-Schwerpunkte die Vertauschung, die die kleinste Summe liefert</li>
<li>Wiederhole 2.–5. solange, bis sich die Cluster-Schwerpunkte nicht mehr ändern</li></ol>
<p>In der ursprünglichen Version von PAM macht hierbei der erste Schritt – die Wahl der initialen Medoiden – einen großen Teil des Algorithmus aus. Da in jeder Iteration stets nur die beste Vertauschung durchgeführt wird, ist der Algorithmus nahezu deterministisch (bis auf exakt gleiche Distanzen). Dadurch ist der Algorithmus aber auch meist sehr langsam.
</p><p>Während k-means die Summe der Varianzen minimiert, minimiert k-Medoids die Distanzen. Insbesondere kann dieser Algorithmus mit beliebigen Distanzfunktionen verwendet werden, und konvergiert dennoch garantiert.
</p>
<div class="mw-heading mw-heading2"><h2 id="Beispiel">Beispiel</h2></div>
<p>Die folgenden Bilder zeigen exemplarisch einen Durchlauf eines <i>k</i>-Means-Algorithmus zur Bestimmung von drei Gruppen:
</p>
<table class="wikitable">
<tbody><tr>
<td><span class="mw-default-size" typeof="mw:File"></span>
</td>
<td>Drei Clusterzentren wurden zufällig gewählt.
</td></tr>
<tr>
<td><span class="mw-default-size" typeof="mw:File"></span>
</td>
<td>Die durch Rechtecke repräsentierten Objekte (Datenpunkte) werden jeweils dem Cluster mit dem nächsten Clusterzentrum zugeordnet.
</td></tr>
<tr>
<td><span class="mw-default-size" typeof="mw:File"></span>
</td>
<td>Die Zentren (jeweilige Schwerpunkte) der Cluster werden neu berechnet.
</td></tr>
<tr>
<td><span class="mw-default-size" typeof="mw:File"></span>
</td>
<td>Die Objekte werden neu verteilt und erneut dem Cluster zugewiesen, dessen Zentrum am nächsten ist.
</td></tr></tbody></table>
<div class="mw-heading mw-heading2"><h2 id="Anwendung_in_der_Bildverarbeitung">Anwendung in der Bildverarbeitung</h2></div>
<p>In der <a href="Bildverarbeitung" title="Bildverarbeitung">Bildverarbeitung</a> wird der <i>k</i>-Means-Algorithmus oft zur <a href="Segmentierung_(Bildverarbeitung)" title="Segmentierung (Bildverarbeitung)">Segmentierung</a> verwendet. Als Entfernungsmaß ist die euklidische Distanz häufig nicht ausreichend und es können andere Abstandsfunktionen, basierend auf <a href="Pixel#Pixelwerte" title="Pixel">Pixelintensitäten</a> und Pixelkoordinaten verwendet werden. Die Ergebnisse werden zur Trennung von Vordergrund und Hintergrund und zur <a href="Objekterkennung" title="Objekterkennung">Objekterkennung</a> benutzt. Der Algorithmus ist weit verbreitet und ist in gängigen Bildverarbeitungsbibliotheken wie <a href="OpenCV" title="OpenCV">OpenCV</a>, <a href="Scikit-image" title="Scikit-image">Scikit-image</a><sup id="cite_ref-16" class="reference"><a href="#cite_note-16"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup> und <a href="Insight_Segmentation_and_Registration_Toolkit" title="Insight Segmentation and Registration Toolkit">itk</a> implementiert.
</p>
<div class="mw-heading mw-heading2"><h2 id="Software">Software</h2></div>
<p>K-means und seine Varianten sind in verschiedener Open-Source-Software verfügbar.
</p>
<ul><li><a href="Dlib" title="Dlib">Dlib</a><sup id="cite_ref-17" class="reference"><a href="#cite_note-17"><span class="cite-bracket">[</span>17<span class="cite-bracket">]</span></a></sup></li>
<li><a href="Environment_for_DeveLoping_KDD-Applications_Supported_by_Index-Structures" title="Environment for DeveLoping KDD-Applications Supported by Index-Structures">ELKI</a> enthält die Varianten von Lloyd und MacQueen, dazu verschiedene Strategien für die Startwerte wie k-means++, und Varianten des Algorithmus wie k-medians, k-medoids und PAM.</li>
<li><a href="GNU_R" class="mw-redirect" title="GNU R">GNU R</a> enthält die Varianten von Hartigan, Lloyd und MacQueen, und zusätzliche Variationen im Erweiterungspaket „flexclust“.</li>
<li><a href="OpenCV" title="OpenCV">OpenCV</a> enthält eine auf Bildverarbeitung optimierte Version von k-means (inkl. k-means++ seeding)</li>
<li><a href="Scikit-learn" title="Scikit-learn">Scikit-learn</a> enthält k-means, inkl. Elkans Variante und k-means++.</li>
<li><a href="Waikato_Environment_for_Knowledge_Analysis" title="Waikato Environment for Knowledge Analysis">Weka</a> enthält k-means (inkl. k-means++ seeding) und die Erweiterung x-means.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Literatur">Literatur</h2></div>
<ul><li>David MacKay: <cite style="font-style:italic">Information Theory, Inference and Learning Algorithms</cite>. Cambridge University Press, 2003, ISBN 0-521-64298-1, Chapter 20. An Example Inference Task: Clustering, <span style="white-space:nowrap">S.<span style="display:inline-block;width:.2em">&nbsp;</span>284–292</span> (<a rel="nofollow" class="external text" href="http://www.inference.phy.cam.ac.uk/mackay/itprnn/ps/284.292.pdf">inference.phy.cam.ac.uk</a> [PDF]).<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abookitem&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.atitle=Chapter+20.+An+Example+Inference+Task%3A+Clustering&amp;rft.au=David+MacKay&amp;rft.btitle=Information+Theory%2C+Inference+and+Learning+Algorithms&amp;rft.date=2003&amp;rft.genre=bookitem&amp;rft.isbn=0521642981&amp;rft.pages=284-292&amp;rft.pub=Cambridge+University+Press" style="display:none">&nbsp;</span></li>
<li>Gary Bradski, Adrian Kaehler: <cite style="font-style:italic">Learning OpenCV Computer Vision with the OpenCV Library</cite>. O’Reilly, 2001, ISBN 978-0-596-51613-0.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.au=Gary+Bradski%2C+Adrian+Kaehler&amp;rft.btitle=Learning+OpenCV+Computer+Vision+with+the+OpenCV+Library&amp;rft.date=2001&amp;rft.genre=book&amp;rft.isbn=9780596516130&amp;rft.pub=O%E2%80%99Reilly" style="display:none">&nbsp;</span></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Einzelnachweise">Einzelnachweise</h2></div>
<div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-OpenCV.479-1"><span class="mw-cite-backlink"><a href="#cite_ref-OpenCV.479_1-0">↑</a></span> <span class="reference-text">
Gary Bradski, Adrian Kaehler: <cite style="font-style:italic">Learning OpenCV Computer Vision with the OpenCV Library</cite>. O’Reilly, 2001, ISBN 978-0-596-51613-0, <span style="white-space:nowrap">S.<span style="display:inline-block;width:.2em">&nbsp;</span>479–480</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.au=Gary+Bradski%2C+Adrian+Kaehler&amp;rft.btitle=Learning+OpenCV+Computer+Vision+with+the+OpenCV+Library&amp;rft.date=2001&amp;rft.genre=book&amp;rft.isbn=9780596516130&amp;rft.pages=479-480&amp;rft.pub=O%E2%80%99Reilly" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-macqueen1967-2"><span class="mw-cite-backlink"><a href="#cite_ref-macqueen1967_2-0">↑</a></span> <span class="reference-text">
J. B. MacQueen: <cite style="font-style:italic">Some Methods for classification and Analysis of Multivariate Observations</cite>. In: <cite style="font-style:italic">Proceedings of 5th Berkeley Symposium on Mathematical Statistics and Probability</cite>. <span style="white-space:nowrap">Band<span style="display:inline-block;width:.2em">&nbsp;</span>1</span>. University of California Press, 1967, <span style="white-space:nowrap">S.<span style="display:inline-block;width:.2em">&nbsp;</span>281–297</span> (<a rel="nofollow" class="external text" href="http://projecteuclid.org/euclid.bsmsp/1200512992">projecteuclid.org</a> [abgerufen am 7.&nbsp;April 2009]).<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.atitle=Some+Methods+for+classification+and+Analysis+of+Multivariate+Observations&amp;rft.au=J.+B.+MacQueen&amp;rft.btitle=Proceedings+of+5th+Berkeley+Symposium+on+Mathematical+Statistics+and+Probability&amp;rft.date=1967&amp;rft.genre=book&amp;rft.pages=281-297&amp;rft.pub=University+of+California+Press&amp;rft.volume=1" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-Steinhaus.801-804-3"><span class="mw-cite-backlink"><a href="#cite_ref-Steinhaus.801-804_3-0">↑</a></span> <span class="reference-text">
<a href="Hugo_Steinhaus" title="Hugo Steinhaus">Hugo Steinhaus</a>: <cite class="lang" lang="fr" dir="auto" style="font-style:italic">Sur la division des corps matériels en parties</cite>. In: <cite class="lang" lang="fr" dir="auto" style="font-style:italic">Bull. Acad. Polon. Sci.</cite> 12. Auflage. <span style="white-space:nowrap">Band<span style="display:inline-block;width:.2em">&nbsp;</span>4</span>, 1957, <span style="white-space:nowrap">S.<span style="display:inline-block;width:.2em">&nbsp;</span>801–804</span> (französisch).<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.atitle=Sur+la+division+des+corps+mat%C3%A9riels+en+parties&amp;rft.au=Hugo+Steinhaus&amp;rft.btitle=Bull.+Acad.+Polon.+Sci.&amp;rft.date=1957&amp;rft.edition=12&amp;rft.genre=book&amp;rft.pages=801-804&amp;rft.volume=4" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-lloyd1957-4"><span class="mw-cite-backlink"><a href="#cite_ref-lloyd1957_4-0">↑</a></span> <span class="reference-text">
S. P. Lloyd: <cite style="font-style:italic">Least square quantization in PCM</cite>. In: <cite style="font-style:italic">Bell Telephone Laboratories Paper</cite>. 1957.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.atitle=Least+square+quantization+in+PCM&amp;rft.au=S.+P.+Lloyd&amp;rft.btitle=Bell+Telephone+Laboratories+Paper&amp;rft.date=1957&amp;rft.genre=book" style="display:none">&nbsp;</span>, später erst in einer Zeitschrift:<br>
S. P. Lloyd: <cite style="font-style:italic">Least squares quantization in PCM</cite>. In: <cite style="font-style:italic"><a href="IEEE_Transactions_on_Information_Theory" title="IEEE Transactions on Information Theory">IEEE Transactions on Information Theory</a></cite>. 2. Auflage. <span style="white-space:nowrap">Band<span style="display:inline-block;width:.2em">&nbsp;</span>28</span>, 1982, <span style="white-space:nowrap">S.<span style="display:inline-block;width:.2em">&nbsp;</span>129–137</span>, <a href="Digital_Object_Identifier" title="Digital Object Identifier">doi</a>:<span class="uri-handle" style="white-space:nowrap"><a rel="nofollow" class="external text" href="https://doi.org/10.1109/TIT.1982.1056489">10.1109/TIT.1982.1056489</a></span> (<a rel="nofollow" class="external text" href="http://www.cs.toronto.edu/~roweis/csc2515-2006/readings/lloyd57.pdf">cs.toronto.edu</a> [PDF; <span style="white-space:nowrap">1,3<span style="display:inline-block;width:.2em">&nbsp;</span>MB</span>; abgerufen am 15.&nbsp;April 2009]).<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.atitle=Least+squares+quantization+in+PCM&amp;rft.au=S.+P.+Lloyd&amp;rft.btitle=IEEE+Transactions+on+Information+Theory&amp;rft.date=1982&amp;rft.doi=10.1109%2FTIT.1982.1056489&amp;rft.edition=2&amp;rft.genre=book&amp;rft.pages=129-137&amp;rft.volume=28" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-forgy65-5"><span class="mw-cite-backlink"><a href="#cite_ref-forgy65_5-0">↑</a></span> <span class="reference-text">
E.W. Forgy: <cite style="font-style:italic">Cluster analysis of multivariate data: efficiency versus interpretability of classifications</cite>. In: <cite style="font-style:italic">Biometrics</cite>. 21. Auflage. 1965, <span style="white-space:nowrap">S.<span style="display:inline-block;width:.2em">&nbsp;</span>768–769</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.atitle=Cluster+analysis+of+multivariate+data%3A+efficiency+versus+interpretability+of+classifications&amp;rft.au=E.W.+Forgy&amp;rft.btitle=Biometrics&amp;rft.date=1965&amp;rft.edition=21&amp;rft.genre=book&amp;rft.pages=768-769" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-hartigan1975-6"><span class="mw-cite-backlink"><a href="#cite_ref-hartigan1975_6-0">↑</a></span> <span class="reference-text">
J.A. Hartigan: <cite style="font-style:italic">Clustering algorithms</cite>. John Wiley &amp; Sons, 1975.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.au=J.A.+Hartigan&amp;rft.btitle=Clustering+algorithms&amp;rft.date=1975&amp;rft.genre=book&amp;rft.pub=John+Wiley+%26+Sons" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-hartigan1979-7"><span class="mw-cite-backlink"><a href="#cite_ref-hartigan1979_7-0">↑</a></span> <span class="reference-text">
J. A. Hartigan, M. A. Wong: <cite style="font-style:italic">Algorithm AS 136: A K-Means Clustering Algorithm</cite>. In: <cite style="font-style:italic">Journal of the Royal Statistical Society, Series C (Applied Statistics)</cite>. 1. Auflage. <span style="white-space:nowrap">Band<span style="display:inline-block;width:.2em">&nbsp;</span>28</span>, 1979, <span style="white-space:nowrap">S.<span style="display:inline-block;width:.2em">&nbsp;</span>100–108</span>, <a href="JSTOR" title="JSTOR">JSTOR</a>:<a rel="nofollow" class="external text" href="http://www.jstor.org/stable/2346830">2346830</a>.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.atitle=Algorithm+AS+136%3A+A+K-Means+Clustering+Algorithm&amp;rft.au=J.+A.+Hartigan%2C+M.+A.+Wong&amp;rft.btitle=Journal+of+the+Royal+Statistical+Society%2C+Series+C+%28Applied+Statistics%29&amp;rft.date=1979&amp;rft.edition=1&amp;rft.genre=book&amp;rft.pages=100-108&amp;rft.volume=28" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-Ester,Sander-8"><span class="mw-cite-backlink"><a href="#cite_ref-Ester,Sander_8-0">↑</a></span> <span class="reference-text">
Martin Ester, Jörg Sander: <cite style="font-style:italic">Knowledge Discovery in Databases: Techniken und Anwendungen</cite>. Springer, Berlin 2000, ISBN 3-540-67328-8.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.au=Martin+Ester%2C+J%C3%B6rg+Sander&amp;rft.btitle=Knowledge+Discovery+in+Databases%3A+Techniken+und+Anwendungen&amp;rft.date=2000&amp;rft.genre=book&amp;rft.isbn=3540673288&amp;rft.place=Berlin&amp;rft.pub=Springer" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><a href="#cite_ref-9">↑</a></span> <span class="reference-text">David Arthur, Sergei Vassilvitskii: <cite style="font-style:italic">K-means++: The Advantages of Careful Seeding</cite>. In: <cite style="font-style:italic">Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms</cite>. Society for Industrial and Applied Mathematics, Philadelphia, PA, USA 2007, ISBN 978-0-89871-624-5, <span style="white-space:nowrap">S.<span style="display:inline-block;width:.2em">&nbsp;</span>1027–1035</span> (<a rel="nofollow" class="external text" href="http://theory.stanford.edu/~sergei/slides/BATS-Means.pdf">stanford.edu</a> [PDF; abgerufen am 27.&nbsp;März 2015]).<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.atitle=K-means%2B%2B%3A+The+Advantages+of+Careful+Seeding&amp;rft.au=David+Arthur%2C+Sergei+Vassilvitskii&amp;rft.btitle=Proceedings+of+the+Eighteenth+Annual+ACM-SIAM+Symposium+on+Discrete+Algorithms&amp;rft.date=2007&amp;rft.genre=book&amp;rft.isbn=9780898716245&amp;rft.pages=1027-1035&amp;rft.place=Philadelphia%2C+PA%2C+USA&amp;rft.pub=Society+for+Industrial+and+Applied+Mathematics" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><a href="#cite_ref-10">↑</a></span> <span class="reference-text">T. Kanungo, D. M. Mount, N. S. Netanyahu, C. D. Piatko, R. Silverman, A. Y. Wu: <cite class="lang" lang="en" dir="auto" style="font-style:italic">An efficient k-means clustering algorithm: Analysis and implementation</cite>. In: <cite class="lang" lang="en" dir="auto" style="font-style:italic">IEEE Trans. Pattern Analysis and Machine Intelligence</cite>. Vol. 24, 2002, <span style="white-space:nowrap">S.<span style="display:inline-block;width:.2em">&nbsp;</span>881–892</span>, <a href="Digital_Object_Identifier" title="Digital Object Identifier">doi</a>:<span class="uri-handle" style="white-space:nowrap"><a rel="nofollow" class="external text" href="https://doi.org/10.1109/TPAMI.2002.1017616">10.1109/TPAMI.2002.1017616</a></span> (englisch, <a rel="nofollow" class="external text" href="http://www.cs.umd.edu/~mount/Papers/pami02.pdf">umd.edu</a> [PDF; abgerufen am 24.&nbsp;April 2009]).<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.atitle=An+efficient+k-means+clustering+algorithm%3A+Analysis+and+implementation&amp;rft.au=T.+Kanungo%2C+D.+M.+Mount%2C+N.+S.+Netanyahu%2C+...&amp;rft.btitle=IEEE+Trans.+Pattern+Analysis+and+Machine+Intelligence&amp;rft.date=2002&amp;rft.doi=10.1109%2FTPAMI.2002.1017616&amp;rft.genre=book&amp;rft.pages=881-892&amp;rft.volume=Vol.+24" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-Elkan-11"><span class="mw-cite-backlink"><a href="#cite_ref-Elkan_11-0">↑</a></span> <span class="reference-text">
C. Elkan: <cite style="font-style:italic">Using the triangle inequality to accelerate k-means</cite>. In: <cite style="font-style:italic">Proceedings of the Twentieth International Conference on Machine Learning (ICML)</cite>. 2003 (<a rel="nofollow" class="external text" href="http://www-cse.ucsd.edu/~elkan/kmeansicml03.pdf">ucsd.edu</a> [PDF; <span style="white-space:nowrap">88<span style="display:inline-block;width:.2em">&nbsp;</span>kB</span>]).<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.atitle=Using+the+triangle+inequality+to+accelerate+k-means&amp;rft.au=C.+Elkan&amp;rft.btitle=Proceedings+of+the+Twentieth+International+Conference+on+Machine+Learning+%28ICML%29&amp;rft.date=2003&amp;rft.genre=book" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><a href="#cite_ref-12">↑</a></span> <span class="reference-text">A. K. Jain, R. C. Dubes: <i>Algorithms for Clustering Data</i>, Prentice-Hall, 1981.</span>
</li>
<li id="cite_note-13"><span class="mw-cite-backlink"><a href="#cite_ref-13">↑</a></span> <span class="reference-text">P. S. Bradley, O. L. Mangasarian, W. N. Street: <i>Clustering via Concave Minimization.</i> In: M. C. Mozer, M. I. Jordan, T. Petsche (Hrsg.): <i>Advances in Neural Information Processing Systems</i>, vol. 9, MIT Press, Cambridge MA 1997, S. 368–374.</span>
</li>
<li id="cite_note-kanungo-14"><span class="mw-cite-backlink"><a href="#cite_ref-kanungo_14-0">↑</a></span> <span class="reference-text">
T. Kanungo, D. Mount, N. Netanyahux, C. Piatko, R. Silverman, A. Wu <a rel="nofollow" class="external text" href="http://www.cs.umd.edu/~mount/Projects/KMeans/kmlocal-cgta.pdf"><i>A Local Search Approximation Algorithm for </i>k<i>-Means Clustering</i>.</a> (PDF; 170&nbsp;kB) In: <i>Computational Geometry: Theory and Applications</i>, 2004.</span>
</li>
<li id="cite_note-15"><span class="mw-cite-backlink"><a href="#cite_ref-15">↑</a></span> <span class="reference-text">S. Vinod: <cite style="font-style:italic">Integer programming and the theory of grouping</cite>. In: <cite style="font-style:italic">Journal of the American Statistical Association</cite>. <span style="white-space:nowrap">Band<span style="display:inline-block;width:.2em">&nbsp;</span>64</span>, 1969, <span style="white-space:nowrap">S.<span style="display:inline-block;width:.2em">&nbsp;</span>506--517</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:K-Means-Algorithmus&amp;rft.atitle=Integer+programming+and+the+theory+of+grouping&amp;rft.au=S.+Vinod&amp;rft.btitle=Journal+of+the+American+Statistical+Association&amp;rft.date=1969&amp;rft.genre=book&amp;rft.pages=506--517&amp;rft.volume=64" style="display:none">&nbsp;</span></span>
</li>
<li id="cite_note-16"><span class="mw-cite-backlink"><a href="#cite_ref-16">↑</a></span> <span class="reference-text"><span class="cite"><a rel="nofollow" class="external text" href="http://scikit-image.org/docs/dev/api/skimage.segmentation.html"><i>Module: segmentation — skimage docs.</i></a><span class="Abrufdatum"> Abgerufen am 8.&nbsp;September 2018</span> (englisch).</span><span style="display: none;" class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Fde.wikipedia.org%3AK-Means-Algorithmus&amp;rft.title=Module%3A+segmentation+%E2%80%94+skimage+docs&amp;rft.description=Module%3A+segmentation+%E2%80%94+skimage+docs&amp;rft.identifier=http%3A%2F%2Fscikit-image.org%2Fdocs%2Fdev%2Fapi%2Fskimage.segmentation.html&amp;rft.language=en">&nbsp;</span></span>
</li>
<li id="cite_note-17"><span class="mw-cite-backlink"><a href="#cite_ref-17">↑</a></span> <span class="reference-text"><span class="cite"><a rel="nofollow" class="external text" href="http://dlib.net/kkmeans_ex.cpp.html"><i>dlib C++ Library - kkmeans_ex.cpp.</i></a><span class="Abrufdatum"> Abgerufen am 8.&nbsp;Januar 2019</span>.</span><span style="display: none;" class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Fde.wikipedia.org%3AK-Means-Algorithmus&amp;rft.title=dlib+C%2B%2B+Library+-+kkmeans_ex.cpp&amp;rft.description=dlib+C%2B%2B+Library+-+kkmeans_ex.cpp&amp;rft.identifier=http%3A%2F%2Fdlib.net%2Fkkmeans_ex.cpp.html">&nbsp;</span></span>
</li>
</ol></div></div><!--htdig_noindex--><div><div class="zim-footer">
Dieser Artikel wurde von <a class="external text" title="Zuletzt bearbeitet am 2025-03-27" href="https://de.wikipedia.org/wiki/?title=K-Means-Algorithmus&amp;oldid=254606489">Wikipedia</a> herausgegeben. Der Text ist unter <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.de">Creative Commons Attribution-Share Alike 4.0</a> verfügbar, sofern nicht anders angegeben. Für die Mediendateien können zusätzliche Bedingungen gelten.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
<script src="./_webp_/webpHandler.js"></script>

</body></html>